package com.jerry.chat.controller;

import com.jerry.chat.Ret;
import com.jerry.chat.dao.FriendCircleMapper;
import com.jerry.chat.domain.FriendCircle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/friendCircle")
public class FriendCircleController {

    @Autowired
    private FriendCircleMapper friendCircleMapper;

    @PostMapping("/send")
    public Ret SendFriendCircle(@RequestBody FriendCircle friendCircle) {
        // 将朋友圈消息持久化到数据库中
        friendCircleMapper.insert(friendCircle);

        // 将朋友圈消息的ID插入到好友的时间轴中，并推送给相应的好友
        // 获取好友列表

        return Ret.succeed();
    }

    @GetMapping("/me")
    public Ret GetFriendCircle(String id) {
        return Ret.succeed().setObject(null);
    }
}
